package com.jjsj.mall.shop.service.impl;

import com.jjsj.mall.shop.entity.YoshopUserReceipte;
import com.jjsj.mall.shop.mapper.YoshopUserReceipteMapper;
import com.jjsj.mall.shop.service.IYoshopUserReceipteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户发票Service业务层处理
 *
 * @author www.joolun.com
 * @date 2022-10-24
 */
@Service
public class YoshopUserReceipteServiceImpl implements IYoshopUserReceipteService {
    @Autowired
    private YoshopUserReceipteMapper yoshopUserReceipteMapper;

    /**
     * 查询用户发票
     *
     * @param receipteId 用户发票ID
     * @return 用户发票
     */
    @Override
    public YoshopUserReceipte selectYoshopUserReceipteById(String receipteId) {
        return yoshopUserReceipteMapper.selectYoshopUserReceipteById(receipteId);
    }

    /**
     * 查询用户发票列表
     *
     * @param yoshopUserReceipte 用户发票
     * @return 用户发票
     */
    @Override
//    @DataSource(value = DataSourceType.SLAVE)
    public List<YoshopUserReceipte> selectYoshopUserReceipteList(YoshopUserReceipte yoshopUserReceipte) {
        return yoshopUserReceipteMapper.selectYoshopUserReceipteList(yoshopUserReceipte);
    }

    /**
     * 新增用户发票
     *
     * @param yoshopUserReceipte 用户发票
     * @return 结果
     */
    @Override
    public int insertYoshopUserReceipte(YoshopUserReceipte yoshopUserReceipte) {
        return yoshopUserReceipteMapper.insertYoshopUserReceipte(yoshopUserReceipte);
    }

    /**
     * 修改用户发票
     *
     * @param yoshopUserReceipte 用户发票
     * @return 结果
     */
    @Override
    public int updateYoshopUserReceipte(YoshopUserReceipte yoshopUserReceipte) {
        return yoshopUserReceipteMapper.updateYoshopUserReceipte(yoshopUserReceipte);
    }

    /**
     * 批量删除用户发票
     *
     * @param receipteIds 需要删除的用户发票ID
     * @return 结果
     */
    @Override
    public int deleteYoshopUserReceipteByIds(String[] receipteIds) {
        return yoshopUserReceipteMapper.deleteYoshopUserReceipteByIds(receipteIds);
    }

    /**
     * 删除用户发票信息
     *
     * @param receipteId 用户发票ID
     * @return 结果
     */
    @Override
    public int deleteYoshopUserReceipteById(String receipteId) {
        return yoshopUserReceipteMapper.deleteYoshopUserReceipteById(receipteId);
    }
}
